package dynamic;

/**
 * @author liuchaoqun
 * @date 2022/7/19
 * @Description 签署股票
 */
public class SalePrice {
    public static void main(String[] args) {

        int[] price = new int[10];
        price[0] = 7;
        price[1] = 1;
        price[2] = 5;
        price[3] = 3;
        price[4] = 6;
        price[5] = 4;
        int maxValue = Integer.MIN_VALUE;
        int minPrice = Integer.MAX_VALUE;
        for (int i : price) {
            if (i < minPrice) {
                minPrice = i;
            }
        }
        for (int i : price) {
            if (i - minPrice > maxValue) {
                maxValue = i - minPrice;
            }
        }
        System.out.println(maxValue);

    }
}
